package org.codegallery.javagal.concurrent.cpj;

import EDU.oswego.cs.dl.util.concurrent.Executor;

public class HostWithExecutor {
	protected long localState;
	protected final Helper helper = new Helper();
	
	protected final Executor executor;

	 public HostWithExecutor(Executor e) { executor = e; }


	protected synchronized void updateState() {
		// localState = ...;
	}

	public void req() {
		updateState();
		try {
			executor.execute(new Runnable(){
				public void run(){
					helper.handle();
				}
			});
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
